/**
 * Created by PoLeung on 2020-02-15.
 */
$(function () {
    //执行函数;
    getEcharts1();

    function getEcharts1() {
        var dom = document.getElementById("echart1");
        var myChart = echarts.init(dom);
        var option = {
            title:{
                text:'漏刻有时联动钻取数据指标',
                x:'center',
                top:'5%',
                textStyle:{
                    color:'#fff',
                    fontSize:'16'
                }
            },
            tooltip: {
                trigger: 'axis',
                axisPointer:{
                    type:'line'
                },
                confine:true,
                //extraCssText:'width:150px!important;height:150px'
            },
            gird: {
                right: '2%',
                left: '5%',
                top:'3%',
                containLabel:true
            },
            xAxis: {
                type: 'category',
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                },
                data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
            },
            yAxis: {
                type: 'value',
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            },
            series: [{
                data: [820, 932, 901, 934, 1290, 1330, 1320],
                type: 'bar',
                label:{
                    show:true,
                    position:'top',
                    textStyle:{
                        color:'#fff'
                    }
                }
            }]
        };

        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    }

})
